<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<title>Involvement</title>
	<link rel="stylesheet" type="text/css" href="css/frame.css" />
	<link rel="stylesheet" type="text/css" href="jscalendar/calendar-blue.css"/>
	<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="content-language" content="es"/>
	<script language="javascript" src="js/validator.js"></script>
	<script language="javascript" src="js/interlineado.js"></script>
	<script language="javascript" src="involvement/involvement.js"></script>
	<script type="text/javascript" src="jscalendar/calendar.js"></script>
	<script type="text/javascript" src="jscalendar/lang/calendar-en.js"></script>
	<script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
</head>
<body onload="loadValidationVarsForFinish();" style="padding-left:4px; padding-bottom:5px;">
	<form id="InvolvementForm" method="post">
		<input id="project" name="project" type="hidden" value="${project.projectKey.id}"/>
		<input id="activity" name="activity" type="hidden" value="${activity.activityKey.id}"/>
		<h2>Activity Contributions</h2>
	
		<h4>Project</h4>
		
		<table class="master-table">
			<tr>
			  	<td class="master-table-label">Id:</td>
			  	<td class="master-table-value">${project.projectKey.id}</td>
			</tr>
			<tr>
			  	<td class="master-table-label">Name:</td>
			  	<td class="master-table-value">${project.name}</td>
			</tr>
			<tr>
			  	<td class="master-table-label">Description:</td>
			  	<td class="master-table-value">${project.description}</td>
			</tr>
		</table>
		
		<h4>Activity</h4>
		
		<table class="master-table">
		<tr>
		  <td class="master-table-label">Id:</td>
		  <td class="master-table-value">${activity.activityKey.id}</td>
		</tr>
		<tr>
		  <td class="master-table-label">Name:</td>
		  <td class="master-table-value">${activity.name}</td>
		</tr>
		
		<tr>
		  <td class="master-table-label">Description:</td>
		  <td class="master-table-value">${activity.description}</td>
		</tr>
		</table>
		
		<h4>Finish Involvement</h4>
		
		<span class="input-label">&nbsp;&nbsp;Responsible:</span>
		<input name="responsibleId" type="text" size="10" id="responsibleId" value="${involvement.responsible.personKey.id}" readonly="readonly"/>
		<input name="responsibleName" type="text" size="40" id="responsibleName" value="${involvement.responsible.name}" readonly="readonly" />
		<a title="Select a responsible" href="javascript:loadLookupPerson();"><img src="img/lookup.png" alt="" title="Select a responsible" style="border-width:0px;" /></a>
		<br/>
		<br/>
		
		<span class="input-label">&nbsp;&nbsp;Beginning:</span>
		<input name="beginning" type="text" id="beginning" value="<fmt:formatDate value='${involvement.beginning}' pattern='yyyy-MM-dd'/>" readonly="readonly"/>
		<br/>
		<br/>

		<span class="input-label">&nbsp;&nbsp;Planned End:</span>
		<input name="plannedEnd" type="text" id="plannedEnd" value="<fmt:formatDate value='${involvement.plannedEnd}' pattern='yyyy-MM-dd'/>" readonly="readonly"/>
		<br/>
		<br/>
		
		<span class="input-label">*Real End:</span>
		<input name="realEnd" type="text" size="10" id="realEnd" value="<fmt:formatDate value='${involvement.realEnd}' pattern='yyyy-MM-dd'/>" />&nbsp;<img id="realEndButton" src="img/calendar.png" style="cursor:pointer;" />
		<br/>
		<br/>
		
		<span class="input-label">*Score:</span>
		<select name="score" id="score">
			<option <c:if test="${involvement.score == 0 || involvement.score == null}">selected="selected"</c:if> value="">&nbsp;</option>
			<option <c:if test="${involvement.score == 1}">selected="selected"</c:if> value="1">1</option>
			<option <c:if test="${involvement.score == 2}">selected="selected"</c:if> value="2">2</option>
			<option <c:if test="${involvement.score == 3}">selected="selected"</c:if> value="3">3</option>
			<option <c:if test="${involvement.score == 4}">selected="selected"</c:if> value="4">4</option>
			<option <c:if test="${involvement.score == 5}">selected="selected"</c:if> value="5">5</option>
		</select>
		<br/>
		<br/>
		<br/>
		
		<a class="link-button" onclick="return v.exec();" href="javascript:finishInvolvement(${involvement.responsible.personKey.id});">Save</a>

		<a class="link-button" href="javascript:listInvolvement();">Cancel</a> 
	</form>
	<script type="text/javascript">	  
	  Calendar.setup(
	   	{
	      inputField  : "realEnd",         // ID of the input field
	      ifFormat    : "%Y-%m-%d",    // the date format
	      button      : "realEndButton"       // ID of the button
	    }
	  );
</script>
</body>
</html>